/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.quadbac.measurements;
import java.io.Serializable;
import java.util.*;

/**
 * a collection of unit types associated with a particular quantity e.g. Length
 * @author Steve Goodson
 */
@SuppressWarnings("serial")
public class MeasurementType implements Serializable {

    private ArrayList<Unit> typeUnits = new ArrayList<Unit>();
    private String typeName;
    private String typeSymbol;
    /**
     * Constructor for MeasurementType class
     * @param typeName - name of measurement type e.g. "Length"
     * @param typeSymbol - symbol for measurement type e.g. "l"
     */
    public MeasurementType(){
    }
    public MeasurementType(String typeName, String typeSymbol){
        this();
        this.typeName = typeName;
        this.typeSymbol = typeSymbol;
    }
    public Object[] toArray() {
        return typeUnits.toArray();
    }
    public boolean add(Unit newUnit){
        return typeUnits.add(newUnit);
    }
    public boolean remove(Unit removeUnit){
        return typeUnits.remove(removeUnit);
    }
    public int size() {
        return typeUnits.size();
    }

    /**
     * Get the value of typeUnits
     *
     * @return the value of typeUnits
     */
    public ArrayList<Unit> getTypeUnits() {
        return typeUnits;
    }
    /**
     * Get the value of typeName
     *
     * @return the value of typeName
     */
    public String getTypeName(){
        return typeName;
    }
    /**
     * Get the value of typeSymbol
     *
     * @return the value of typeSymbol
     */
    public String getTypeSymbol(){
        return typeSymbol;
    }
    /**
     * Set the value of typeUnits
     *
     * @param typeUnits new value of typeUnits
     */
    public void setTypeUnits(ArrayList<Unit> typeUnits) {
        this.typeUnits = typeUnits;
    }
    /**
     * Set the value of typeName
     *
     * @param typeName new value of typeName
     */
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    /**
     * Set the value of typeSymbol
     *
     * @param typesymbol new value of typeSymbol
     */
    public void setTypeSymbol(String typeSymbol) {
        this.typeSymbol = typeSymbol;
    }
	@Override
	public String toString() {
		return this.getTypeName();
	}
    
}
